package com.xf.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.scenes.scene2d.Actor;

public class FirstActor extends Actor {
    Texture texture;

    @Override
    public void draw(Batch batch, float parentAlpha) {
        super.draw(batch, parentAlpha);
        batch.draw(texture, this.getX(), this.getY());
    }

    @Override
    public Actor hit(float x, float y, boolean touchable) {
        if (x > 0 && y > 0 && this.getHeight() > y && this.getWidth() > x) {
            return super.hit(x, y, touchable);
        } else {
            return null;
        }
    }

    public FirstActor() {
        super();
        texture = new Texture(Gdx.files.internal("actor.png"));
        setHeight(texture.getHeight());
        setWidth(texture.getWidth());
    }
}